package org.hyperzsoft.one;

import android.content.Context;
import android.os.Process;

public class GetSchedule implements Runnable {
	private static final String LOG_TAG = "GetSchedule";
	
	private Thread mThread;
	private volatile boolean mStopped;
	
	public GetSchedule(Context context) {
		
	}
	
	public void start() {
		if (mThread == null) {
			mStopped = false;
			mThread = new Thread(this, LOG_TAG);
		}
	}
	
	public void stop() {
		if (mThread != null) {
			mStopped = true;
			mThread.interrupt();
			mThread = null;
		}
	}
	
	@Override
	public void run() {
		Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
		
		 while (!mStopped) {
			 try {
				 
				 Thread.sleep(1000);
			} catch (InterruptedException e) {
				// ignore
			}
		 }
	}
	
}